package beerAir;

import javax.persistence.*;

public class BookingController {

	public String insertUser(User u){
		
		EntityManagerFactory factory;
		EntityManager manager;
		factory = Persistence.createEntityManagerFactory("BeerAir");
		manager = factory.createEntityManager();
		
		try{
		manager.getTransaction().begin();
		manager.persist(u);
		manager.getTransaction().commit();
		}catch(Exception e) {
			return "ERROR: Cannot insert user, check data";
		}
		return null;
	}
	
}
